package com.yc.cloud.openai.portal.dto.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class XFSpeechToTextResponse {


    @JsonProperty("data")
    private List<DataDTO> data;
    @JsonProperty("sid")
    private String sid;
    @JsonProperty("code")
    private String code;
    @JsonProperty("desc")
    private String desc;

    @NoArgsConstructor
    @Data
    public static class DataDTO {
        @JsonProperty("sub")
        private String sub;
        @JsonProperty("auth_id")
        private String authId;
        @JsonProperty("text")
        private String text;
        @JsonProperty("result_id")
        private Integer resultId;
        @JsonProperty("json_args")
        private JsonArgsDTO jsonArgs;
        @JsonProperty("intent")
        private IntentDTO intent;
        @JsonProperty("content")
        private String content;

        @NoArgsConstructor
        @Data
        public static class JsonArgsDTO {
            @JsonProperty("language")
            private String language;
            @JsonProperty("accent")
            private String accent;
        }

        @NoArgsConstructor
        @Data
        public static class IntentDTO {
            @JsonProperty("answer")
            private AnswerDTO answer;
            @JsonProperty("no_nlu_result")
            private Integer noNluResult;
            @JsonProperty("operation")
            private String operation;
            @JsonProperty("rc")
            private Integer rc;
            @JsonProperty("service")
            private String service;
            @JsonProperty("serviceCategory")
            private String serviceCategory;
            @JsonProperty("serviceName")
            private String serviceName;
            @JsonProperty("serviceType")
            private String serviceType;
            @JsonProperty("sid")
            private String sid;
            @JsonProperty("text")
            private String text;
            @JsonProperty("uuid")
            private String uuid;
            @JsonProperty("voice_answer")
            private List<VoiceAnswerDTO> voiceAnswer;

            @NoArgsConstructor
            @Data
            public static class AnswerDTO {
                @JsonProperty("answerType")
                private String answerType;
                @JsonProperty("emotion")
                private String emotion;
                @JsonProperty("question")
                private QuestionDTO question;
                @JsonProperty("text")
                private String text;
                @JsonProperty("topicID")
                private String topicID;
                @JsonProperty("type")
                private String type;

                @NoArgsConstructor
                @Data
                public static class QuestionDTO {
                    @JsonProperty("question")
                    private String question;
                    @JsonProperty("question_ws")
                    private String questionWs;
                }
            }

            @NoArgsConstructor
            @Data
            public static class VoiceAnswerDTO {
                @JsonProperty("content")
                private String content;
                @JsonProperty("type")
                private String type;
            }
        }
    }
}
